﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
using System.Runtime.Serialization;

namespace MobiMenu.Restaurant
{
    [Table(Name = "Advertisements")]
    [DataContract(Namespace = "MobiMenu.Restaurant")]
    public class Advertisement
    {
        private EntityRef<Dish> _relatedDish;
        public Advertisement() { this._relatedDish = new EntityRef<Dish>(); }

        [Association(Storage = "_relatedDish", ThisKey = "RelatedDishId")]
        public Dish RelatedDish
        {
            get
            {
                return _relatedDish.Entity;
            }
            set
            {
                _relatedDish.Entity = value;
            }
        }

        private int? _relatedDishId;
        [Column(Storage = "_relatedDishId")]
        [DataMember(Name = "relatedDishId")]
        public int? RelatedDishId
        {
            get
            {
                return _relatedDishId;
            }
            set
            {
                _relatedDishId = value;
            }
        }

        private string _title;
        [Column(Storage = "_title")]
        [DataMember(Name = "title")]
        public string Title
        {
            get
            {
                return _title;
            }
            set
            {
                _title = value;
            }
        }

        private string _content;
        [Column(Storage = "_content")]
        [DataMember(Name = "content")]
        public string Content
        {
            get
            {
                return _content;
            }
            set
            {
                _content = value;
            }
        }

        private bool _showInMenu;
        [Column(Storage = "_showInMenu")]
        [DataMember(Name = "showInMenu")]
        public bool ShowInMenu
        {
            get
            {
                return _showInMenu;
            }
            set
            {
                _showInMenu = value;
            }
        }

        private int _id;
        [Column(IsPrimaryKey = true, Storage = "_id", IsDbGenerated = true)]
        [DataMember(Name = "id")]
        public int Id
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
            }
        }
    }
}
